import request from "./request";

// export const LoginApi = (params:any) => request.post('/1024/login',params)
// export const LoginApi = (params:ILoginParmas) => request.post('/1024/login',params)
// 登录请求
export const LoginApi = (params: ILoginParmas): IPR<string> =>
  request.post("/1024/login", params);
// 注册请求
export const RegisterApi = (params: IRegisterParmas): IPR<string> =>
  request.post("/1024/register", params);
// 首页
export const HomeApi = (): IPR<IHomeData> => request.get("/6666");
// 快速刷题
export const FastApi = (): IPR<IFastData> => request.get("/4698");

export const questionTypeDataApi = (
  actionCode: string | undefined
): IPR<IQuestionTypeKeyMap[]> => request.get(`/1314/${actionCode}/all`);

export const getQuestionListApi = (
  params: IQuestionParams
): IPR<IQuestionItem[]> => request.post("/1314", params);

export const switchSubjectApi = (
  actionCode: string | undefined
): IPR<ISubjectsItem[]> => request.get(`/6666/${actionCode}`);

export const SidebarApi = (): IPR<ISidebarItem[]> => request.get("/6666/field");

export const SubmitContentApi = (params: ISubmitContent): IPR<ISubmitContent> =>
  request.put("/1314", params);
